﻿{layout:default} {class:Shop.Admin.order.Order_Edit}
<lbhead>
    <title><%=Tag("订单管理")%>-<%=site.title%></title>
</lbhead>
<lbpath>
    <div class="tools">
        <ul>
            <%if (PageReturnMsg == ""){%>
            <li class="submit"><a href="javascript:void(0);" onclick="SaveOrder();"><b></b><span><%=Tag("保存")%></span></a></li>
            <%}%>
            <li class="rotate"><a href="javascript:void(0);" onclick="history.back();"><b></b><span><%=Tag("返回")%></span></a></li>
            <li class="name"><span id="navIgation"><%=Tag("当前位置")%>：<a href="<%=site.AdminPath %>/Ajax/ajax_admin.aspx?__Action=MenuJump&pid=0"><%=Tag("管理首页")%></a>
                > <a href="<%=site.AdminPath %>/order/default.aspx"><%=Tag("订单管理")%></a> >
                <%=model.Code %>
            </span></li>
        </ul>
    </div>
</lbpath>
<lbbody>
    <table class="datalist" border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr class="title">
            <th colspan="4">
                <%=Tag("基本信息")%>：
            </th>
        </tr>
        <tr class="list">
            <td style="width: 100px;">
                <%=Tag("订单编号")%>：
            </td>
            <td style="width: 350px;">
                <%=model.Code%>
            </td>
            <td style="width: 100px;">
                <%=Tag("订购时间")%>：
            </td>
            <td>
                <%=FormatTime(model.Time_Add) %>
            </td>
        </tr>
        <tr class="list">
            <td>
                <%=Tag("订单金额")%>：
            </td>
            <td colspan="3">
                <%=Tag("总金额")%>：<%=model.Money_Order%>

                <%=Tag("商品")%>：<%=model.Money_Product%>

                <%=Tag("运费")%>：<%=model.Money_Transport%>

                <%=Tag("税金")%>：<%=model.Money_Bill%>
            </td>
        </tr>
        <tr class="list">
            <td>
                <%=Tag("获得积分")%>：
            </td>
            <td colspan="3">
                <%=model.Point%>
            </td>
        </tr>
        <tr class="list">
            <td>
                <%=Tag("配送方式")%>：
            </td>
            <td>
                <%=model.Transport_Name%>
            </td>
            <td>
                <%=Tag("支付方式")%>：
            </td>
            <td>
                <%=Shop.Bussiness.Language.Content(model.Pay,CurrentLanguage)%>
            </td>
        </tr>

    </table>

    <table class="datalist" border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr class="title">
            <th colspan="4">
                <%=Tag("收货人信息")%>： <a href="javascript:Editshouhuo();"><%=Tag("编辑")%></a>
            </th>
        </tr>
        <tr class="list">
            <td style="width: 100px;">
                <%=Tag("收货人")%>：
            </td>
            <td style="width: 350px;">
                <%=model.T_Name %>
            </td>
            <td style="width: 100px;">
                <%=Tag("邮箱")%>：
            </td>
            <td>
                <%=model.T_Email %>
            </td>
        </tr>
        <tr class="list">
            <td >
                <%=Tag("手机")%>：
            </td>
            <td >
                <%=model.T_MobilePhone %>
            </td>
            <td >
                <%=Tag("电话")%>：
            </td>
            <td>
                <%=model.T_Phone %>
            </td>
        </tr>
        <tr class="list">
            <td >
                <%=Tag("邮编")%>：
            </td>
            <td >
                <%=model.T_Postalcode %>
            </td>
            <td >
                <%=Tag("地区")%>：
            </td>
            <td >
                <%=Shop.Bussiness.EX_Area.GetAreaName(model.T_Area_id)%>
            </td>
        </tr>
        <tr class="list">
            <td >
                <%=Tag("地址")%>：
            </td>
            <td colspan="3" >
                <%=model.T_Address %>
            </td>
            
        </tr>
    </table>
   
       <table class="datalist" border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr class="title">
            <th colspan="4">
                <%=Tag("订单状态")%>： 
            </th>
        </tr>
        <tr class="list">
            <td style="width: 100px;">
                <%=Tag("状态")%>：
            </td>
            
            <td>
                <input type="checkbox" value="1" shop="true" name="IsVerified" <%=model.IsVerified==1?"checked":"" %> />
                <%=Tag("确认")%>
                <input type="checkbox" value="1" shop="true" name="IsPaid" <%=model.IsPaid==1?"checked":"" %> />
                <%=Tag("支付")%>
                <input type="checkbox" value="1" shop="true" name="IsShipped" <%=model.IsShipped==1?"checked":"" %> />
                <%=Tag("发货")%>
                <input type="checkbox" value="1" shop="true" name="IsReceived" <%=model.IsReceived==1?"checked":"" %> />
                <%=Tag("收货")%>
                <input type="checkbox" value="1" shop="true" name="IsCompleted" <%=model.IsCompleted==1?"checked":"" %> />
                <%=Tag("完成")%>
                <input type="checkbox" value="1" shop="true" name="IsInvalid" <%=model.IsInvalid==1?"checked":"" %> />
                <%=Tag("无效")%> 
            </td>
        </tr>

        <tr class="list">
            <td >
                <%=Tag("内部备注")%>：
            </td>
                
            <td>
                <textarea id="Remark_Admin" shop="true" class="input" style="width:600px;height:80px;"><%=model.Remark_Admin%></textarea>
            </td>
        </tr>
    </table>

    <table class="datalist" border="0" cellpadding="0" cellspacing="0" width="100%">
       <tr class="title">
            <th colspan="4">
                <%=Tag("订单商品")%>：<a href="javascript:Pro_Del();"><%=Tag("删除所选")%></a> <a href="javascript:Pro_Save();"><%=Tag("保存")%></a>
            </th>
        </tr>
        <tr class="title">
             <th style="width: 40px" class="selectAll">
                <a href="javascript:void(0);" onclick="$('input[name=\'id\']').attr('checked',!$(this).attr('checked'));$(this).attr('checked',!$(this).attr('checked'));"><%=Tag("全选")%></a>
            </th>
            <th style="width: 100px">
                <%=Tag("图片")%>
            </th>
            <th style="width: 100px">
                <%=Tag("编号")%>
            </th>
            <th >
                <%=Tag("名称")%>
            </th>
            <th style="width: 100px">
                <%=Tag("数量")%>
            </th>
            <th style="width: 100px">
                <%=Tag("金额")%>
            </th>
            <th style="width: 100px">
                <%=Tag("小计")%>
            </th>
        </tr>
        <%foreach (Shop.Model.Lebi_Order_Product pro in pros)
          { %>
        <tr class="list">
             <td>
                <input type="checkbox" name="proid" value="<%=pro.id %>" del="true" />
                <input type="hidden" name="proid" value="<%=pro.id %>" pro="true" style="display:none" />
             </td>
             <td>
                <img src="<%=pro.ImageSmall %>" style="width:30px" />
             </td>
             <td>
                
             </td>
             <td>
                <%=Shop.Bussiness.Language.Content(pro.Product_Name,CurrentLanguage) %>
             </td>
             <td>
                <input type="text" class="input" pro="true" name="Count<%=pro.id %>"  id="Count<%=pro.id %>" value="<%=pro.Count %>" onkeyup="value=value.replace(/[^\d]/g,'')" style="width: 70px;" />
             </td>
             <td>
                <input type="text" class="input" pro="true" name="Price<%=pro.id %>" id="Price<%=pro.id %>" value="<%=pro.Price %>" onkeyup="value=value.replace(/[^\d]/g,'')" style="width: 70px;" />
             </td>
             <td>
                <%=pro.Money%>
             </td>
        </tr>
        <% } %>
    </table>
    <script type="text/javascript">
        function SaveOrder() {
            var postData = GetFormJsonData("shop");
            var url = "<%=site.AdminPath %>/ajax/ajax_order.aspx?__Action=Order_Edit&id=<%=model.id %>";
            RequestAjax(url,postData,function(){MsgBox(1, "<%=Tag("操作成功")%>", "?")});
        }
        function Editshouhuo() {
            var title_ = "<%=Tag("编辑收货人")%>";
            var url_ = "shouhuo_Edit_window.aspx?id=<%=model.id %>";
            var width_ = 600;
            var height_ = "auto";
            var modal_ = true;
            EditWindow(title_, url_, width_, height_, modal_);
        }
        function Pro_Del() {
            if (!confirm("<%=Tag("确认要删除吗？")%>"))
                return false;
            var postData = GetFormJsonData("del");
            var url = "<%=site.AdminPath %>/ajax/ajax_order.aspx?__Action=OrderPro_Del&id=<%=model.id %>";
            RequestAjax(url,postData,function(){MsgBox(1, "<%=Tag("操作成功")%>", "?")});
        }
        function Pro_Save() {
            var postData = GetFormJsonData("pro");
            var url = "<%=site.AdminPath %>/ajax/ajax_order.aspx?__Action=OrderPro_Edit&id=<%=model.id %>";
            RequestAjax(url,postData,function(){MsgBox(1, "<%=Tag("操作成功")%>", "?")});
        }
    </script>
</lbbody>